-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(symbolicator): Replace log with tracing #534
Conversation
This partially reverts commit ee1243b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually pretty straight forward, I like it!
Maybe you can take a look at #515 and cherry-pick the instrumentation and sentry-tracing layer.
Other than that, please reach out to ops about whether we actually use these logs (json formatted?) somewhere. If we might change the format or if we need to keep backwards compatibility.
@@ -366,6 +368,44 @@ impl Config { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] | |||
struct LevelFilterVisitor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an alternative would be to define our own enum for this with a derived Deserialize
, and convert between these two directly.
I'd rather add instrumentation and structure in a second PR tbh. As for the sentry-tracing layer, is there anything more that needs to be done other than add a |
So before the most recent commit, some python tests were failing with a message about how they couldn't find a port or some such. Turns out, these tests start a symbolicator process and then wait for a specific log line from |
Yes we use JSON formatted logs in production, you can get to them from the symbolicator metrics dashboard by following the "stackdriver logs" link. |
The most recent commit (5142030) solves the problem of keeping log output exactly the same in the simplest way: instead of using a |
I preferred the version where you removed log entirely. We should be able to make sure the tracing subscriber json output includes at least the same fields as we had before and then we're good. I think in the future it would be nice to also start using the tracing macros with extra fields which would show up in the json log and make our log search much more useful. |
@flub Is it clear that there's no harm in adding extra fields to the json logs? |
96948cd
to
3775d1c
Compare
Codecov Report
@@ Coverage Diff @@
## master #534 +/- ##
==========================================
+ Coverage 74.09% 74.27% +0.18%
==========================================
Files 47 47
Lines 10434 10419 -15
==========================================
+ Hits 7731 7739 +8
+ Misses 2703 2680 -23
Continue to review full report at Codecov.
|
3775d1c
to
37721b1
Compare
Alright, I think this is finally ready for serious consideration. JSON log output doesn't line up exactly, but after talking to @oioki we think it shouldn't be a problem.
New log line:
|
agree the json differences are fine. let's merge this 🎉 |
As a first step towards using
tracing
in symbolicator, this simply replaces the variouslog
macros with theirtracing
equivalents. The more difficult part is setting up the subscribers (tracing
's loggers):Pretty
,Simplified
, andJson
log formats use the builtin stylespretty
,compact
, andJson
, respectively. Notably, theLogRecord
struct is obsolete. The same goes forBreadcrumbLogger
, whose functionality is now handled bysentry-tracing
.tracing
'sLevelFilter
doesn't implementDeserialize
, soconfig.rs
contains a manual deserialization function.This PR doesn't exactly play to
tracing
's strengths, as there are no spans and no structured logs. It's intended to introducetracing
with minimum hassle.